//
//  HSYImproveStoreInformationRequest.m
//  HSY
//
//  Created by 陈浩 on 2017/4/6.
//  Copyright © 2017年 金开门. All rights reserved.
//

#import "HSYImproveStoreInformationRequest.h"

@implementation HSYImproveStoreInformationRequest


- (NSString *)serviceCode{
    return API_SERVICE_CODE_IMPROVE_STORE_INFORMATION;
}

- (NSDictionary *)requestData{
    NSAssert(self.mainStoreID.length > 0, @"商铺编号不能为空");
    NSAssert(self.shortName.length > 0, @"商店名称不能为空");
    NSAssert(self.districtCode.length > 0, @"店铺所属城市不能为空");
    NSAssert(self.address.length > 0, @"店铺所属街道不能为空");

    NSMutableDictionary *params = [@{} mutableCopy];
    params[@"id"] = self.mainStoreID;
    params[@"shortName"] = self.shortName;
    params[@"districtCode"] = self.districtCode;
    params[@"address"] = self.address;
    params[@"fileA"] = @"LICENCE";
    params[@"isPublic"] = @(self.isPublic);
    
    if (self.licenceNO.length > 0) {
        params[@"licenceNO"] = self.licenceNO;
    }

    if (self.licenceStartDate.length > 0) {
        params[@"licenceStartDate"] = self.licenceStartDate;
    }
    
    if (self.licenceEndDate.length > 0) {
        params[@"licenceEndDate"] = self.licenceEndDate;
    }
    return params;
}


- (NSArray<HSYFileModel *> *)files{
    if (self.fileData) {
        HSYFileModel *model = [[HSYFileModel alloc] init];
        model.fileData = self.fileData;
        model.suffix = @"jpg";
        model.fileType = @"fileA";
        model.mimeType = @"image/png";
        
        return @[model];
    }else{
        return nil;
    }
}

- (BOOL)fileUplaod{
    return YES;
}


@end
